/* $RCSFile: ADNDynIncidentresolution.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/DynEntities/ADNDynIncidentresolution.cs $
 * $log$
 * Revision 19 2010/10/02 14:01:49  christian.surieux
 *   Corrected a bug in allmost everyADNDyn file for PrimaryFieldVualue
 * Revision 6 2010/08/06 19:56:33  christian.surieux
 *   Added Log to All cs files
 */

/* Copyrights Christian Surieux 2010 */
/* Class ADNDynIncidentresolution */
/* Date 2010-01-06 16:03:43Z */

using System;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using CrmSdk;

namespace AddonNice.CRMWrapper
{
    public class ADNDynIncidentresolution : DynEntity
    {
        protected class Ftor: DFactor
        {
            public Ftor() : base(CrmStr.incidentresolution)
            {}

            public override Type DynType
            { get { return typeof(ADNDynIncidentresolution); } }

            public override string DynTypename
            {   get{ return CrmStr.incidentresolution;}}

            public override DynEntity Build()
            {   return new ADNDynIncidentresolution();}

            public override DynEntity Build(CRMWrapperBase w, InternalDynamicEntity dEntity, PropertyDescriptorCollection wproperties)
            {   return new ADNDynIncidentresolution(w, dEntity, wproperties, null);}

            public override DynEntity Build(CRMWrapperBase w, string PrimaryFieldValue)
            {   return new ADNDynIncidentresolution(w, PrimaryFieldValue);}

            public override DynEntity Build(CRMWrapperBase w,Guid PrimaryKeyValue)
            {   return new ADNDynIncidentresolution(w,PrimaryKeyValue);}
        }

        static ADNDynIncidentresolution(){new Ftor();} 


        public override bool HasOwningBusinessUnitProperty
        { get { return true; } }
        
        public ADNDynIncidentresolution() : base() { }
        
        public ADNDynIncidentresolution(CRMWrapperBase w,string PrimaryFieldValue)
            : base(w,CrmStr.incidentresolution)
        {
            if ( PrimaryFieldValue != string.Empty )
                subject = PrimaryFieldValue;
        }
        
        public ADNDynIncidentresolution(CRMWrapperBase w,Guid CrmId) : base(w,CrmStr.incidentresolution,CrmId) { }
        
        public ADNDynIncidentresolution(CRMWrapperBase w,InternalDynamicEntity e) : base(w,CrmStr.incidentresolution,e,null,null) { }
        
        public ADNDynIncidentresolution(CRMWrapperBase w,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s) : base(w,CrmStr.incidentresolution,e,prop,s) { }
        
        public ADNDynIncidentresolution(ResetWrapperHandler fn,string PrimaryFieldValue)
            : base(fn,CrmStr.incidentresolution)
        {
            if ( PrimaryFieldValue != string.Empty )
                subject = PrimaryFieldValue;
        }
        
        public ADNDynIncidentresolution(ResetWrapperHandler fn,Guid CrmId) : base(fn,CrmStr.incidentresolution,CrmId) { }
        
        public ADNDynIncidentresolution(ResetWrapperHandler fn,InternalDynamicEntity e) : base(fn,CrmStr.incidentresolution,e,null,null) { }
        
        public ADNDynIncidentresolution(ResetWrapperHandler fn,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s) : base(fn,CrmStr.incidentresolution,e,prop,s) { }

        /* Properties */

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public Guid activityid
        {
            get
            { return KeyPropertyValue(CrmStr.activityid); }
            set
            { AddKeyProperty(CrmStr.activityid,value); }
        }

        protected override void SetCrmIdProperty(Guid crmId)
        {
            if ( !dicProperty.ContainsKey(CrmStr.activityid) || KeyPropertyValue(CrmStr.activityid) != crmId )
                activityid = crmId;
        }
        public override Guid PrimaryKeyGuidValue
        {
            get
            { return activityid; }
            set { activityid = value; }
        }
        
        public override string PrimaryFieldName
        {
            get
            { return CrmStr.subject; }
            set
            {}
        }

        /// <summary>
        /// Value contained in the PrimaryField for the DynEntity or empty if no PrimaryField
        /// </summary>
        public override string PrimaryFieldStringValue
        {
            get
            {
                return subject;
            }
            set
            {
                subject =   value;
            }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public int actualdurationminutes
        {
            get
            { return NumberPropertyValue(CrmStr.actualdurationminutes); }
            set
            { AddNumberProperty(CrmStr.actualdurationminutes,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public string actualend
        {
            get
            { return DateTimePropertyValue(CrmStr.actualend); }
            set
            { AddDateTimeProperty(CrmStr.actualend,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public string actualstart
        {
            get
            { return DateTimePropertyValue(CrmStr.actualstart); }
            set
            { AddDateTimeProperty(CrmStr.actualstart,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public string category
        {
            get
            { return StringPropertyValue(CrmStr.category); }
            set
            { AddStringProperty(CrmStr.category,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public string description
        {
            get
            { return StringPropertyValue(CrmStr.description); }
            set
            { AddStringProperty(CrmStr.description,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public Guid incidentid
        {
            get
            { return LookupPropertyValue(CrmStr.incidentid); }
            set
            { AddLookupProperty(CrmStr.incidentid,CrmStr.incident,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public string incidentidName
        {
            get
            { return LookupPropertyName(CrmStr.incidentid); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public string incidentidType
        {
            get
            { return LookupPropertyType(CrmStr.incidentid); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public bool isbilled
        {
            get
            { return BooleanPropertyValue(CrmStr.isbilled); }
            set
            { AddBooleanProperty(CrmStr.isbilled,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public bool isworkflowcreated
        {
            get
            { return BooleanPropertyValue(CrmStr.isworkflowcreated); }
            set
            { AddBooleanProperty(CrmStr.isworkflowcreated,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public Guid owningbusinessunit
        {
            get
            { return LookupPropertyValue(CrmStr.owningbusinessunit); }
            set
            { AddLookupProperty(CrmStr.owningbusinessunit,CrmStr.businessunit,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public Guid owninguser
        {
            get
            { return LookupPropertyValue(CrmStr.owninguser); }
            set
            { AddLookupProperty(CrmStr.owninguser,CrmStr.systemuser,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public int scheduleddurationminutes
        {
            get
            { return NumberPropertyValue(CrmStr.scheduleddurationminutes); }
            set
            { AddNumberProperty(CrmStr.scheduleddurationminutes,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public string scheduledend
        {
            get
            { return DateTimePropertyValue(CrmStr.scheduledend); }
            set
            { AddDateTimeProperty(CrmStr.scheduledend,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public string scheduledstart
        {
            get
            { return DateTimePropertyValue(CrmStr.scheduledstart); }
            set
            { AddDateTimeProperty(CrmStr.scheduledstart,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public Guid serviceid
        {
            get
            { return LookupPropertyValue(CrmStr.serviceid); }
            set
            { AddLookupProperty(CrmStr.serviceid,CrmStr.service,value); }
        }

        public string serviceName
        {
            get
            { return LookupPropertyName(CrmStr.serviceid); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public string subcategory
        {
            get
            { return StringPropertyValue(CrmStr.subcategory); }
            set
            { AddStringProperty(CrmStr.subcategory,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public string subject
        {
            get
            { return StringPropertyValue(CrmStr.subject); }
            set
            { AddStringProperty(CrmStr.subject,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public int timespent
        {
            get
            { return NumberPropertyValue(CrmStr.timespent); }
            set
            { AddNumberProperty(CrmStr.timespent,value); }
        }

        [CrmDynAttribute(CrmStr.incidentresolution)]
        public int timezoneruleversionnumber
        {
            get
            { return NumberPropertyValue(CrmStr.timezoneruleversionnumber); }
            set
            { AddNumberProperty(CrmStr.timezoneruleversionnumber,value); }
        }
    }
}